package com.googlecode.mgwt.examples.showcase.client;

import com.googlecode.mgwt.examples.showcase.client.i18n.BaseLabels;
import com.googlecode.mgwt.examples.showcase.client.i18n.DemoLabels;
import com.googlecode.mgwt.examples.showcase.client.i18n.IrisLabels;
import com.googlecode.mgwt.examples.showcase.client.i18n.Labels;


public class UserProfile {

	private UserProfileEnum currentUser;
	public enum UserProfileEnum{
		IRIS_ZAHAL(new IrisLabels(), new IrisServiceCallRenderer()),
		DEMO(new DemoLabels(), new DemoServiceCallRenderer());
		private BaseLabels labels;
		private ServiceCallRenderer serviceCallRenderer;
		private UserProfileEnum(BaseLabels labels, ServiceCallRenderer renderer){
			this.labels = labels;
			this.serviceCallRenderer = renderer;
		}
		
		public Labels getLabels() {
			return labels;
		}
		
		public ServiceCallRenderer getServiceCallRenderer() {
			return serviceCallRenderer;
		}
	
	}
	public UserProfile(int userProfileID){
		currentUser = UserProfileEnum.values()[userProfileID];
	}
	
	public UserProfile() {
		// TODO Auto-generated constructor stub
	}
	
	public void setCurrentUser(Integer currentUserID) {
		if(currentUserID == null){
			currentUser = UserProfileEnum.DEMO;
		}
		else{
			currentUser = UserProfileEnum.values()[currentUserID];
		}
	}
	public UserProfileEnum getCurrentUser() {
		return currentUser;
	}
	
}
